package thread;

import com.alibaba.druid.support.logging.Log;
import com.alibaba.druid.support.logging.LogFactory;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Author: volc
 * @Description: 从队列中获取任务数据并执行——解析gps文件
 * @Date: 18:09 2018/3/17
 */
public class ThreadPoll {
    private static Log logger = LogFactory.getLog(ThreadPoll.class);
    // 创建线程池大小
    ExecutorService exec = Executors.newFixedThreadPool(2);

    public void analysis() {
        logger.debug("?&=======开始消费队列任务：");
        exec.execute(new ThreadClass(1));
        exec.shutdown();
        logger.debug("?&=======结束消费队列任务：");
        while (!exec.isTerminated()) {
        }
    }
}
